package com.hornsun.domain.constant.types;

/**
 * Created by 编译中... on 2018/4/19.
 */
public enum GenderType {
    MAN(1,"男"),
    WOMEN(2,"女");

    private Integer type;
    private String name;

    GenderType(Integer type ,String name){this.type=type;this.name=name;}

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static GenderType fromName(String name) {
        for (GenderType genderType : values()) {
            if (genderType.name.equals(name) ) {
                return genderType;
            }
        }
        return null;
    }
}
